#include "nodeinput.h"
#include "../../core/resources/resourcemanager.h"

namespace gunsmith
{
CNodeInput::CNodeInput() : CNode(NT_INPUT)
{
	m_pResInput = m_pResMngr->CreateResource<CResourceInput>(RID_INPUT_SYSTEM, NULL);
}

CNodeInput::~CNodeInput()
{
	
}

void CNodeInput::Update(float fDelta, void *pData)
{
	// capture Keyboard
	if(m_pResInput->GetKeyboard())
		m_pResInput->GetKeyboard()->capture();
	
	// capture Mouse
	if(m_pResInput->GetMouse())
		m_pResInput->GetMouse()->capture();

	// capture JoyStick
	if(m_pResInput->GetJoyStick())
		m_pResInput->GetJoyStick()->capture();
}

CResourceInput* CNodeInput::GetInput()
{
	return m_pResInput;
}
};